package com.msb.serviceDriverUser.service;

import com.msb.internalcommon.dto.ResponseResult;
import com.msb.serviceDriverUser.mapper.DriverUserMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @Auther: jiudianliu
 * @Date: 2023/7/24 - 07 - 24 - 10:49
 * @Description: com.msb.serviceDriverUser.service
 * @version: 1.0
 */
@Service
public class CityDriverUserService {

    @Autowired
    DriverUserMapper driverUserMapper ;

    /**
     * 根据CcityCode 城市码 查询该城市是否有可用的司机
     * @param cityCode
     * @return
     */
    public ResponseResult<Boolean> isAvailableDriver(String cityCode){
        int i = driverUserMapper.selectDriverUserCountByCityCode(cityCode);
        if (i > 0){
            return ResponseResult.success(true);
        }else{
            return ResponseResult.success(false);
        }
    }

}
